import { NextRequest } from 'next/server';
import { checkAuth } from './lib/auth';

export function middleware(request: NextRequest) {
  // 只对管理后台路由应用身份验证
  if (request.nextUrl.pathname.startsWith('/admin')) {
    return checkAuth(request);
  }
}

export const config = {
  matcher: ['/admin/:path*']
};